package com.phillong.factory.factorymethod.store;

import com.phillong.factory.factorymethod.creator.Pizza;
import com.phillong.factory.factorymethod.creator.PizzaStore;
import com.phillong.factory.factorymethod.pizza.china.ChinaCheesePizza;
import com.phillong.factory.factorymethod.pizza.china.ChinaDurianPizza;
import com.phillong.factory.factorymethod.pizza.china.ChinaHandPizza;


/**
 * @author zhangpeng
 */
public class ChinaPizzaStore extends PizzaStore {
    @Override
    protected Pizza createPizza(String type) {
        Pizza pizza = null;
        if ("cheese".equals(type)){
            pizza = new ChinaCheesePizza();
        }
        if ("hand".equals(type)){
            pizza = new ChinaHandPizza();
        }
        if ("durian".equals(type)){
            pizza = new ChinaDurianPizza();
        }
        return pizza;
    }
}
